//
//  SystemViewController.m
//  HaierGMS_APP
//
//  Created by 堂堂 on 16/11/1.
//  Copyright © 2016年 堂堂. All rights reserved.
//

#import "SystemViewController.h"
#import "UIColor+Hex.h"
#import "LoginViewController.h"
@interface SystemViewController ()

@end

@implementation SystemViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.outBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.outBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithHexString:@"#ff7e00"]] forState:UIControlStateNormal];
    [self.outBtn setBackgroundImage:[self createImageWithColor:[UIColor colorWithHexString:@"#55ff7e00"]] forState:UIControlStateSelected];
    [self.outBtn addTarget:self action:@selector(outBtn_click) forControlEvents:UIControlEventTouchUpInside];
}
-(void)outBtn_click{
    UIStoryboard *sb= [UIStoryboard storyboardWithName:@"App_Main" bundle:[NSBundle mainBundle]];
    LoginViewController *loginVc = [sb instantiateViewControllerWithIdentifier:@"login_view"];
    [self presentViewController:loginVc animated:YES completion:nil];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)back_click:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (UIImage*) createImageWithColor: (UIColor*) color
{
    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage*theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    
    return theImage;
}
@end
